package org.nightrunner.d3.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;

/**
 * 装备表
 * 
 * @author NightRunner
 * @Date 2012-7-26
 * @version 1.0
 */

@Entity
@Indexed
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Table(name = "d3_property", catalog = "d3")
public class Property implements java.io.Serializable {

	private static final long serialVersionUID = 4623891446740040393L;

	/**
	 *装备为ID
	 */
	@DocumentId
	private String propertyId;

	/**
	 *装备名称
	 */
	@Field(index = Index.TOKENIZED, store = Store.YES, name = "propertyName")
	private String propertyName;

	/**
	 *装备简称
	 */
	@Field(index = Index.TOKENIZED, store = Store.YES, name = "propertyAbbreviationName")
	private String propertyAbbreviationName;

	@Field(index = Index.TOKENIZED, store = Store.YES, name = "propertyDescription")
	private String propertyDescription;

	@Field(index = Index.TOKENIZED, store = Store.YES, name = "propertyKeywords")
	private String propertyKeywords;

	@Column(name = "property_description", length = 256)
	public String getPropertyDescription() {
		return propertyDescription;
	}

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "property_id", nullable = false, length = 32)
	public String getPropertyId() {
		return this.propertyId;
	}

	@Column(length = 200, name = "property_name")
	public String getPropertyName() {
		return propertyName;
	}

	@Column(length = 200, name = "property_keywords")
	public String getPropertyKeywords() {
		return propertyKeywords;
	}

	@Column(length = 200, name = "property_abbreviation_name")
	public String getPropertyAbbreviationName() {
		return propertyAbbreviationName;
	}

	/** default constructor */
	public Property() {
	}

	/** minimal constructor */
	public Property(String propertyId) {
		this.propertyId = propertyId;
	}

	public void setPropertyKeywords(String propertyKeywords) {
		this.propertyKeywords = propertyKeywords;
	}

	public void setPropertyDescription(String propertyDescription) {
		this.propertyDescription = propertyDescription;
	}

	public void setPropertyId(String propertyId) {
		this.propertyId = propertyId;
	}

	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}

	public String toString() {
		return propertyName;
	}

	public void setPropertyAbbreviationName(String propertyAbbreviationName) {
		this.propertyAbbreviationName = propertyAbbreviationName;
	}
}
